﻿/*
 * Cratos Tools - General
 * Cratos Action Attribute class
 * 
 * Copyright (c) 2011-2012 Draco
 * 
 * This file is part of Cratos.
 * 
 * Cratos is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * Cratos is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Cratos.  If not, see <http://www.gnu.org/licenses/>.
 * 
 *       .==.        .==.
 *      //'^\\      //^'\\
 *     // ^ ^\(\__/)/^ ^^\\
 *    //^ ^^ ^/6  6\ ^^ ^ \\
 *   //^ ^^ ^/( .. )\^ ^ ^ \\
 *  // ^^ ^/\| V""V|/\^ ^ ^ \\
 * //^^/\/ /  '~~'  \ \/\^ ^ \\
 *  ------------------------------------
 *  HERE BE DRAGONS
 *  
 *  Johan Dercksen - johan@draco.co.za
 */
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;

namespace Cratos.Tools.General
{
	/// <summary>
	/// Cratos Data Object Action Attribute class
	/// </summary>
	[Serializable]
	[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
	public class DOCratosActionAttribute : Attribute
	{
		#region Class Constant declarations
		#endregion

		#region Class Event declarations
		#endregion

		#region Class Variable declarations
		private DOCratosAction						cratosAction           = DOCratosAction.None;
		private DOCratosCollectionAction	cratosCollectionAction = DOCratosCollectionAction.None;
		#endregion

		#region Class Constructors & Destructors
		/// <summary>
		/// Class Constructor
		/// </summary>
		/// <param name="doAction">Action</param>
		/// <param name="doActionType">Action Type</param>
		/// <param name="isExpectOutput">Expect Output indicator</param>
		/// <param name="actionString">Action String</param>
		public DOCratosActionAttribute(DOCratosAction doAction, DOCratosActionType doActionType, bool isExpectOutput, string actionString) : base()
		{
			// Save all the incoming values
			this.CratosAction						= doAction;
			this.CratosCustomActionName	= "";
			this.CratosActionType				= doActionType;
			this.IsExpectOutput					= isExpectOutput;
			this.ActionString						= actionString;
		}

		/// <summary>
		/// Class Constructor
		/// </summary>
		/// <param name="doAction">Action</param>
		/// <param name="customActionName">Custom Action Name</param>
		/// <param name="doActionType">Action Type</param>
		/// <param name="isExpectOutput">Expect Output indicator</param>
		/// <param name="actionString">Action String</param>
		public DOCratosActionAttribute(DOCratosAction doAction, string customActionName, DOCratosActionType doActionType,
																	 bool isExpectOutput, string actionString) : base()
		{
			// Save all the incoming values
			this.CratosAction						= doAction;
			this.CratosCustomActionName	= customActionName;
			this.CratosActionType				= doActionType;
			this.IsExpectOutput					= isExpectOutput;
			this.ActionString						= actionString;
		}

		/// <summary>
		/// Class Constructor
		/// </summary>
		/// <param name="doCollectionAction">Collection Action</param>
		/// <param name="doActionType">Action Type</param>
		/// <param name="isExpectOutput">Expect Output indicator</param>
		/// <param name="actionString">Action String</param>
		public DOCratosActionAttribute(DOCratosCollectionAction doCollectionAction, DOCratosActionType doActionType, 
																	 bool isExpectOutput, string actionString) : base()
		{
			// Save all the incoming values
			this.CratosCollectionAction = doCollectionAction;
			this.CratosCustomActionName = "";
			this.CratosActionType       = doActionType;
			this.IsExpectOutput         = isExpectOutput;
			this.ActionString           = actionString;
		}

		/// <summary>
		/// Class Constructor
		/// </summary>
		/// <param name="doCollectionAction">Collection Action</param>
		/// <param name="customActionName">Custom Action Name</param>
		/// <param name="doActionType">Action Type</param>
		/// <param name="isExpectOutput">Expect Output indicator</param>
		/// <param name="actionString">Action String</param>
		public DOCratosActionAttribute(DOCratosCollectionAction doCollectionAction, string customActionName, DOCratosActionType doActionType,
																		bool isExpectOutput, string actionString) : base()
		{
			// Save all the incoming values
			this.CratosCollectionAction = doCollectionAction;
			this.CratosCustomActionName = customActionName;
			this.CratosActionType       = doActionType;
			this.IsExpectOutput         = isExpectOutput;
			this.ActionString           = actionString;
		}
		#endregion

		#region Class Properties
		/// <summary>
		/// Cratos Action
		/// </summary>
		public DOCratosAction CratosAction
		{
			get { return (this.cratosAction); }
			set { this.cratosAction = value; }
		}

		/// <summary>
		/// Cratos Collection Action
		/// </summary>
		public DOCratosCollectionAction CratosCollectionAction
		{
			get { return (this.cratosCollectionAction); }
			set { this.cratosCollectionAction = value; }
		}

		/// <summary>
		/// Cratos Custom Action Name
		/// </summary>
		public string CratosCustomActionName { get; set; }

		/// <summary>
		/// Cratos Action Type
		/// </summary>
		public DOCratosActionType CratosActionType { get; set; }

		/// <summary>
		/// Expect Output from Action indicator
		/// </summary>
		public bool IsExpectOutput { get; set; }

		/// <summary>
		/// Action String
		/// </summary>
		public string ActionString { get; set; }

		/// <summary>
		/// Database Connection Name
		/// </summary>
		public string DBConnectionName { get; set; }
		#endregion

		#region Class Methods
		#endregion

		#region Class Support Methods
		#endregion
	}
}
